import {request} from "axios";

export default function ({ page, list, create, update, del }, params = {}, data = {}) {
    return {
        page: () => {
            return request({
                url: page,
                params,
                data,
                method: 'get'
            })
        },
        list: () => {
            return request({
                url: page,
                params,
                data,
                method: 'get'
            })
        },
        create: () => {
            return request({
                url: page,
                params,
                data,
                method: 'post'
            })
        },
        update: () => {
            return request({
                url: page,
                params,
                data,
                method: 'put'
            })
        },
    }
}